#!/sbin/openrc-run
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

command="/usr/bin/shadowircd-ircd"
command_args="${SHADOWIRCD_OPTS}"
command_user="shadowircd"
extra_started_commands="reload"
pidfile="/run/shadowircd/ircd.pid"

depend() {
	use dns net
	provide ircd
}

start_pre() {
    ebegin "Creating /run/shadowircd for ${SVCNAME}"
    checkpath --directory --owner :shadowircd --mode 0770 /run/shadowircd
    eend $?
}

reload() {
	ebegin "Reloading ${SVCNAME}"
	start-stop-daemon --signal HUP --pidfile "${pidfile}"
	eend $?
}
